package com.yxhl.zoume.utils;

import android.content.Context;

import com.github.pwittchen.prefser.library.Prefser;

/**
 * 项目名称：Ferrari
 * Created by menggod on 16/11/20.
 */
public class WeChatPayEntryUtils {
    private static final String IS_WECHAT_RECHARGE= "IS_WECHAT_RECHARGE";
    private static WeChatPayEntryUtils instance = null;
    private Prefser prefser;

    public WeChatPayEntryUtils(Context context) {
        if (null == prefser) {
            prefser = new Prefser(context);
        }
    }

    public static WeChatPayEntryUtils getInstance(Context context) {
        if (instance == null) {
            synchronized (WeChatPayEntryUtils.class) {
                if (instance == null) {
                    instance = new WeChatPayEntryUtils(context);
                }
            }
        }
        return instance;
    }

    public void saveWechatRechargeEntry(boolean isRecharge) {
        prefser.put(IS_WECHAT_RECHARGE, isRecharge);
    }

    public boolean getWechatRechargeEntry() {
        boolean isWechatRecharge = prefser.get(IS_WECHAT_RECHARGE, Boolean.class,false);
        return isWechatRecharge;
    }

}